package com.mcf.xiaolinju.controller;


import com.mcf.xiaolinju.mapper.CollectionMapper;
import com.mcf.xiaolinju.service.impl.CollectionServiceImpl;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mcf
 * @since 2022-03-01
 */
@CrossOrigin
@RestController
@RequestMapping("/xiaolinju/collection")
public class CollectionController {
    @Resource
    CollectionServiceImpl collectionService;
    //查询是否收藏
    @RequestMapping("/selectcount")
    public int selectcount(int id,int userid){
        return collectionService.selectcount(id,userid);
    }
    //小程序取消或添加收藏
    @RequestMapping("/updatecollection")
    public void updatecollection (int id,int userid) {
        collectionService.updatecollection(id,userid);
    }
}
